package sg.edu.nus.iss.vmcs.util;

import sg.edu.nus.iss.vmcs.entity.Coin;
import sg.edu.nus.iss.vmcs.ui.CustomerPanel;

public class CoinValidatorAdapter extends CoinValidator {
	private Coin coin;
	private BestCoinValidator bestCoinValidator;

	public CoinValidatorAdapter(Coin coin) {
		super(coin);
		this.coin = coin;
		this.bestCoinValidator = new BestCoinValidator(coin);
	}
	
	public boolean validateCoin() {
		Coin actualCoin = CustomerPanel.getCoins().get(coin.getId());
		return bestCoinValidator.isValid(actualCoin);
	}

}
